{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Finding cellular regions with superpixel analysis\n",
    "\n",
    "**Overview:**\n",
    "\n",
    "Whole-slide images often contain artifacts like marker or acellular regions that\n",
    "need to be avoided during analysis. In this example we show how HistomicsTK can\n",
    "be used to develop saliency detection algorithms that segment the slide at low\n",
    "magnification to generate a map to guide higher magnification analyses. Here we\n",
    "show how superpixel analysis can be used to locate hypercellular regions that\n",
    "correspond to tumor-rich content.\n",
    "\n",
    "This uses Simple Linear Iterative Clustering (SLIC) to get superpixels at a low\n",
    "slide magnification to detect cellular regions. The first step of this pipeline\n",
    "detects tissue regions (i.e. individual tissue pieces) using the `get_tissue_mask`\n",
    " method of the `histomicstk.saliency` module. Then, each tissue piece is processed\n",
    " separately for accuracy and disk space efficiency. It is important to keep in\n",
    " mind that this does NOT rely on a tile iterator, but loads the entire tissue\n",
    " region (but NOT the whole slide) in memory and passes it on to\n",
    " `skimage.segmentation.slic` method. Not using a tile iterator helps keep the\n",
    " superpixel sizes large enough to correspond to tissue boundaries.\n",
    "\n",
    "Once superpixels are segmented, the image is deconvolved and features are extracted from the hematoxylin channel. Features include intensity and possibly also texture features. Then, a mixed component Gaussian mixture model is fit to the features, and median intensity is used to rank superpixel clusters by 'cellularity' (since we are working with the hematoxylin channel).\n",
    "\n",
    "Note that the decison to fit a gaussian mixture model instead of using K-means clustering is a design choice. If you'd like to experiment, feel free to try other methods of classifying superpixels into clusters using other approaches.\n",
    "\n",
    "Additional functionality includes contour extraction to get the final segmentation boundaries of cellular regions and to visualize them in HistomicsUI using one's preferred colormap.\n",
    "\n",
    "**Here are some sample results:**\n",
    "\n",
    "From left to right: Slide thumbnail, superpixel classifications, contiguous cellular/acellular regions\n",
    "\n",
    "![cdetection](https://user-images.githubusercontent.com/22067552/65730355-7e92b600-e08f-11e9-918a-507f117f6d77.png)\n",
    "\n",
    "**Where to look?**\n",
    "\n",
    "```\n",
    "|_ histomicstk/\n",
    "  |_saliency/\n",
    "     |_cellularity_detection.py \n",
    "     |_tests/\n",
    "        |_test_saliency.py\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tempfile\n",
    "import girder_client\n",
    "import numpy as np\n",
    "from histomicstk.annotations_and_masks.annotation_and_mask_utils import (\n",
    "    delete_annotations_in_slide)\n",
    "from histomicstk.saliency.cellularity_detection_superpixels import (\n",
    "    Cellularity_detector_superpixels)\n",
    "\n",
    "import matplotlib.pylab as plt\n",
    "from matplotlib.colors import ListedColormap\n",
    "%matplotlib inline\n",
    "\n",
    "# color map\n",
    "vals = np.random.rand(256,3)\n",
    "vals[0, ...] = [0.9, 0.9, 0.9]\n",
    "cMap = ListedColormap(1 - vals)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prepwork"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "APIURL = 'http://candygram.neurology.emory.edu:8080/api/v1/'\n",
    "SAMPLE_SLIDE_ID = \"5d586d76bd4404c6b1f286ae\"\n",
    "# SAMPLE_SLIDE_ID = \"5d8c296cbd4404c6b1fa5572\"\n",
    "\n",
    "gc = girder_client.GirderClient(apiUrl=APIURL)\n",
    "gc.authenticate(apiKey='kri19nTIGOkWH01TbzRqfohaaDWb6kPecRqGmemb')\n",
    "\n",
    "# This is where the run logs will be saved\n",
    "logging_savepath = tempfile.mkdtemp()\n",
    "\n",
    "# color normalization values from TCGA-A2-A3XS-DX1\n",
    "cnorm_thumbnail = {\n",
    "    'mu': np.array([9.24496373, -0.00966569,  0.01757247]),\n",
    "    'sigma': np.array([0.35686209, 0.02566772, 0.02500282]),\n",
    "}\n",
    "# from the ROI in Amgad et al, 2019\n",
    "cnorm_main = {\n",
    "    'mu': np.array([8.74108109, -0.12440419,  0.0444982]),\n",
    "    'sigma': np.array([0.6135447, 0.10989545, 0.0286032]),\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# deleting existing annotations in target slide (if any)\n",
    "delete_annotations_in_slide(gc, SAMPLE_SLIDE_ID)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Initialize the cellularity detector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Init Cellularity_Detector_Superpixels object.\n",
      "\n",
      "        Arguments:\n",
      "        -----------\n",
      "        gc : object\n",
      "            girder client object\n",
      "        slide_id : str\n",
      "            girder ID of slide\n",
      "        verbose : int\n",
      "            0 - Do not print to screen\n",
      "            1 - Print only key messages\n",
      "            2 - Print everything to screen\n",
      "            3 - print everything including from inner functions\n",
      "        monitorPrefix : str\n",
      "            text to prepend to printed statements\n",
      "        logging_savepath : str or None\n",
      "            where to save run logs\n",
      "        suppress_warnings : bool\n",
      "            whether to suppress warnings\n",
      "        cnorm_params : dict\n",
      "            Reinhard color normalization parameters. Accepted keys: thumbnail\n",
      "            and main (since thumbnail normalization is different from color\n",
      "            normalization of tissue at target magnification. Each entry is a\n",
      "            dict containing values for mu and sigma. This is either given\n",
      "            here or can be set using self.set_color_normalization_values().\n",
      "            May be left unset if you do not want to normalize.\n",
      "        get_tissue_mask_kwargs : dict\n",
      "            kwargs for the get_tissue_mask() method.\n",
      "        MAG : float\n",
      "            magnification at which to detect cellularity\n",
      "        spixel_size_baseMag : int\n",
      "            approximate superpixel size at base (scan) magnification\n",
      "        compactness : float\n",
      "            compactness parameter for the SLIC method. Higher values result\n",
      "            in more regular superpixels while smaller values are more likely\n",
      "            to respect tissue boundaries.\n",
      "        deconvolve : bool\n",
      "            Whether to deconvolve and use hematoxylin channel for feature\n",
      "            extraction. Must be True to ranks spixel clusters by cellularity.\n",
      "        use_grayscale : bool\n",
      "            If True, grayscale image is used with SLIC. May be more robust to\n",
      "            color variations from slide to slide and more efficient.\n",
      "        use_intensity : bool\n",
      "            Whether to extract intensity features from the hematoxylin channel.\n",
      "            This must be True to rank spuerpixel clusters by cellularity.\n",
      "        use_texture : bool\n",
      "            Whether to extract Haralick texture features from Htx channel. May\n",
      "            not necessarily improve results when used in conjunction with\n",
      "            intensity features.\n",
      "        keep_feats : list\n",
      "            Name of intensity features to use. See\n",
      "            histomicstk.features.compute_intensity_features.\n",
      "            Using fewer informative features may result in better\n",
      "            gaussian mixture modeling results.\n",
      "        n_gaussian_components : int\n",
      "            no of gaussian mixture model components\n",
      "        max_cellularity : int\n",
      "            Range [0, 100] or None. If None, normalize visualization RGB values\n",
      "            for each tissue piece separately, else normalize by given number.\n",
      "        opacity : float\n",
      "            opacity of superpixel polygons when posted to DSA.\n",
      "            0 (no opacity) is more efficient to render.\n",
      "        opacity_contig : float\n",
      "            opacity of contiguous region polygons when posted to DSA.\n",
      "            0 (no opacity) is more efficient to render.\n",
      "        lineWidth : float\n",
      "            width of line when displaying superpixel boundaries.\n",
      "        cMap : object\n",
      "            matplotlib color map to use when visualizing cellularity\n",
      "        visualize_tissue_boundary : bool\n",
      "            whether to visualize result from tissue detection component\n",
      "        visualize_spixels : bool\n",
      "            whether to visualize superpixels, color-coded by cellularity\n",
      "        visualize_contiguous : bool\n",
      "            whether to visualize contiguous cellular regions\n",
      "\n",
      "        \n"
     ]
    }
   ],
   "source": [
    "print(Cellularity_detector_superpixels.__init__.__doc__)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this example, and as the default behavior, we use a handful of informative intensity features extracted from the hematoxylin channel after color deconvolution to fit a gaussian mixture model. Empirically (on a few test slides), this seems to give better results than using the full suite of intensity and texture features available. Feel free to experiment with this and find the optimum combination of features for your application. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Saving logs to: /tmp/tmpt7dygwhf/2019-09-29_18-04.log\n"
     ]
    }
   ],
   "source": [
    "# init cellularity detector\n",
    "cds = Cellularity_detector_superpixels(\n",
    "    gc, slide_id=SAMPLE_SLIDE_ID,\n",
    "    MAG=3.0, compactness=0.1, spixel_size_baseMag=256 * 256,\n",
    "    max_cellularity=40,\n",
    "    visualize_spixels=True, visualize_contiguous=True,\n",
    "    get_tissue_mask_kwargs={\n",
    "        'deconvolve_first': False,\n",
    "        'n_thresholding_steps': 2,\n",
    "        'sigma': 1.5,\n",
    "        'min_size': 500, },\n",
    "    verbose=2, monitorPrefix='test',\n",
    "    logging_savepath=logging_savepath)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Set the color normalization values\n",
    "\n",
    "You can choose to reinhard color normalize the slide thumbnail and/or the tissue image at target magnificaion. You can either provide the mu and sigma values directly or provide the path to an image from which to infer these values. Please refer to the *color_normalization* module for reinhard normalization implementation details. In this example, we use a \"high-sensitivity, low-specificity\" strategy to detect tissue, followed by the more specific cellularity detection module. In other words, the *tissue_detection* module is used to detect all tissue, and only exclude whitespace and marker. Here we do NOT perform color normalization before tissue detection (empirically gives worse results), but we do normalize when detecting the cellular regions within the tissue. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# set color normalization for thumbnail\n",
    "# cds.set_color_normalization_values(\n",
    "#     mu=cnorm_thumbnail['mu'],\n",
    "#     sigma=cnorm_thumbnail['sigma'], what='thumbnail')\n",
    "\n",
    "# set color normalization values for main tissue\n",
    "cds.set_color_normalization_values(\n",
    "    mu=cnorm_main['mu'], sigma=cnorm_main['sigma'], what='main')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Run the detector"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Run cellularity detection and optionally visualize result.\n",
      "\n",
      "        This runs the cellularity detection +/- visualization pipeline and\n",
      "        returns a list of CD_single_tissue_piece objects. Each object has\n",
      "        the following attributes\n",
      "\n",
      "        tissue_mask : np array\n",
      "            mask of where tissue is at target magnification\n",
      "        ymin : int\n",
      "            min y coordinate at base (scan) magnification\n",
      "        xmin : int\n",
      "            min x coordinate at base (scan) magnification\n",
      "        ymax : int\n",
      "            max y coordinate at base (scan) magnification\n",
      "        xmax : int\n",
      "            max x coordinate at base (scan) magnification\n",
      "        spixel_mask : np array\n",
      "            np array where each unique value represents one superpixel\n",
      "        fdata : pandas DataFrame\n",
      "            features extracted for each superpixel. Index corresponds to\n",
      "            values in the spixel_mask. This includes a 'cluster' column\n",
      "            indicatign which cluster this superpixel belongs to.\n",
      "        cluster_props : dict\n",
      "            properties of each superpixel cluster, including its assigned\n",
      "            cellularity score.\n",
      "\n",
      "        \n"
     ]
    }
   ],
   "source": [
    "print(cds.run.__doc__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "test: set_slide_info_and_get_tissue_mask()\n",
      "test: Tissue piece 1 of 2\n",
      "test: Tissue piece 1 of 2: set_tissue_rgb()\n",
      "test: Tissue piece 1 of 2: set_superpixel_mask()\n",
      "test: Tissue piece 1 of 2: set_superpixel_features()\n",
      "test: Tissue piece 1 of 2: set_superpixel_assignment()\n",
      "test: Tissue piece 1 of 2: assign_cellularity_scores()\n",
      "test: Tissue piece 1 of 2: visualize_individual_superpixels()\n",
      "test: Tissue piece 1 of 2: Posting doc 1 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 2 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 3 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 4 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 5 of 5\n",
      "test: Tissue piece 1 of 2: visualize_contiguous_superpixels()\n",
      "test: Tissue piece 1 of 2: Posting doc 1 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 2 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 3 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 4 of 5\n",
      "test: Tissue piece 1 of 2: Posting doc 5 of 5\n",
      "test: Tissue piece 2 of 2\n",
      "test: Tissue piece 2 of 2: set_tissue_rgb()\n",
      "test: Tissue piece 2 of 2: set_superpixel_mask()\n",
      "test: Tissue piece 2 of 2: set_superpixel_features()\n",
      "test: Tissue piece 2 of 2: set_superpixel_assignment()\n",
      "test: Tissue piece 2 of 2: assign_cellularity_scores()\n",
      "test: Tissue piece 2 of 2: visualize_individual_superpixels()\n",
      "test: Tissue piece 2 of 2: Posting doc 1 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 2 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 3 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 4 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 5 of 5\n",
      "test: Tissue piece 2 of 2: visualize_contiguous_superpixels()\n",
      "test: Tissue piece 2 of 2: Posting doc 1 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 2 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 3 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 4 of 5\n",
      "test: Tissue piece 2 of 2: Posting doc 5 of 5\n"
     ]
    }
   ],
   "source": [
    "tissue_pieces = cds.run()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Check the results\n",
    "\n",
    "The resultant list of objects correspond to the results for each \"tissue piece\" detected in the slide. You may explore various attributes like the offset coordinates, tissue mask, superpixel labeled mask, superpixel feature data, and superpixel cluster properties."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7d1a3c0c50>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAACbCAYAAAB77cDK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uGZqfdlkgH8AeDUbmZ9E73i/+4JHn/FuhrxTcDjVfXJvrt2A9u729uBOybdtmFV1bVVtbWqTqI3Bt+oqiuBe4DLuoe10pfngGeSnNbtehfwGO2Nyw+Ac5K8sXuvHepHc2PSZ6kx2A1c1a1GOQf4cV+pZSYluYheyfGSqvrfvrt2A5cnOTLJyfQmZv99oo2rqon9AO+jN4v7FHDdJI+9ynb/Mr1TwIeBb3U/76NXO74beBL4F+CYabd1yH6dD9zZ3X4rvTffXuBvgSOn3b4B+3AGsKcbm78Djm5xXIA/BL4DPAL8DXBkK2MCfIle7f5VemdFVy81BkDorUZ7Cvg2vZU3U+/DMn3ZS6/Wfehv/6/6Hn9d15cngPdOur1+lF6SGuUkpiQ1ygAuSY0ygEtSowzgktQoA7gkNcoALkmNMoBLUqP+H5oOzQDIijDMAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.imshow(tissue_pieces[0].tissue_mask, cmap=cMap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7f7d1c35ad10>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAACdCAYAAAC0Ew80AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2dd3gUxR/G3yEQmnQCSBekSSBI7wI/QIoISBWkSUeKohJUSmjSe4fQgiAElN6RIEU6UhKalAChht77/P7Ym70tM7t7JSEh+3mefW53dm5375Lbd9/vdwqhlMLG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Ash5JRyZ0z9LuKqQ7gCIIdiO7uj7F3nhsPqwfF601Eu+j7i/fdECEkCSQwWUUr/dBQnuO+BQSm9ByAMQDlI1p89tCk/k/x5HfvTALiN+P89VADwOSEkElKYuBqAiUh43wMopVccrzchPSCURiz8LuKqIBwAkM/RusAXUsJo9Vu+pthgNQDWEqANgFWK8taO1gRlAdx3WMdNAGoSQtI5WhzUdJTFCxzx3jkATlJKlRMJJ7Tvwc/hDEAISQ6gBqR8ShiAxo5q2u+BfT+NAWyjUhZxNYDmjtY3HwDIB2B/7HwKz6GU/kQpzU4pzQ3pN7+NUtoSCex7IISkJISkYuuQ/p/DERu/i7edTTfIsteB1OrkHIBf3vb1xMDn+x3ANQAvIcX22kOKf/4F4D8AWwGkd9QlAKY6vovjAEoqjvM1pKTZWQDt3vbncvE7qAgpVnoMwBHHUicBfg9FAfzr+B7CAQxwlOeBdCM7C2AZgKSO8mSO7bOO/XkUx/rF8f2cBlD7bX82D76TKnC2MkpQ34Pj8x51LBHs/hcbvwu7p7KNjY2NDYC4GzKysbGxsYllbEGwsbGxsQFgC4KNjY2NjQNbEGxsbGxsANiCYGNjY2PjwBYEGxsbGxsAtiDY2NjY2DiwBcHGxsbGBgDwf+F2Bp5mQhyBAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.imshow(tissue_pieces[0].spixel_mask, cmap=cMap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Intensity.Mean</th>\n",
       "      <th>Intensity.Median</th>\n",
       "      <th>Intensity.Std</th>\n",
       "      <th>Intensity.IQR</th>\n",
       "      <th>Intensity.HistEntropy</th>\n",
       "      <th>cluster</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>86.639486</td>\n",
       "      <td>74.0</td>\n",
       "      <td>50.329524</td>\n",
       "      <td>34.0</td>\n",
       "      <td>1.775608</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>73.010711</td>\n",
       "      <td>68.0</td>\n",
       "      <td>26.269239</td>\n",
       "      <td>20.0</td>\n",
       "      <td>1.341687</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>67</td>\n",
       "      <td>88.820514</td>\n",
       "      <td>73.0</td>\n",
       "      <td>56.899073</td>\n",
       "      <td>49.0</td>\n",
       "      <td>1.942993</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>68</td>\n",
       "      <td>72.959455</td>\n",
       "      <td>67.0</td>\n",
       "      <td>31.681785</td>\n",
       "      <td>21.0</td>\n",
       "      <td>1.349226</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>71</td>\n",
       "      <td>100.068075</td>\n",
       "      <td>79.0</td>\n",
       "      <td>60.721122</td>\n",
       "      <td>67.0</td>\n",
       "      <td>1.989196</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Intensity.Mean  Intensity.Median  Intensity.Std  Intensity.IQR  \\\n",
       "5        86.639486              74.0      50.329524           34.0   \n",
       "6        73.010711              68.0      26.269239           20.0   \n",
       "67       88.820514              73.0      56.899073           49.0   \n",
       "68       72.959455              67.0      31.681785           21.0   \n",
       "71      100.068075              79.0      60.721122           67.0   \n",
       "\n",
       "    Intensity.HistEntropy  cluster  \n",
       "5                1.775608        4  \n",
       "6                1.341687        4  \n",
       "67               1.942993        5  \n",
       "68               1.349226        4  \n",
       "71               1.989196        5  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tissue_pieces[0].fdata.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1: {'cellularity': 20, 'color': 'rgb(253,253,255)'},\n",
       " 2: {'cellularity': 37, 'color': 'rgb(167,0,0)'},\n",
       " 3: {'cellularity': 47, 'color': 'rgb(127,0,0)'},\n",
       " 4: {'cellularity': 26, 'color': 'rgb(255,105,105)'},\n",
       " 5: {'cellularity': 29, 'color': 'rgb(255,29,29)'}}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tissue_pieces[0].cluster_props"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Check the visualization on HistomicsUI\n",
    "\n",
    "Now you may go to the slide on Digital Slide Archive and check the posted annotations."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
